{#继承父模板#}
{% extends 'common/base.html' %}

{% load staticfiles %}

{#标题#}
{% block title %}满分餐厅｜满分菜品{% endblock title %}

{#头部js#}
{% include 'common/head_js.html' %}

{#页面主体#}
{% block body %}

	<div class="main">
		<div class="topics">
			<div class="container">所有菜品</div>
		</div>
{#        排序行    #}
    <div class="sort_bar">
        <a href="{% url 'dishes:all_dishes' 'dish_praise' %}" {% if param == 'dish_praise' %} class="active" {% endif %}>默认</a>
        <a href="{% url 'dishes:all_dishes' 'dish_price' %}" {% if param == 'dish_price' %} class="active" {% endif %}>价格↓</a>
        <a href="{% url 'dishes:all_dishes' 'dish_response' %}" {% if param == 'dish_response' %} class="active" {% endif %}>人气↓</a>
    </div>

		<div class="container foodsimag">
			<div class="row topics_top">

                {% for dish in dishes %}
				<div class="col-lg-3 col-md-4 col-sm-6 col-xm-6 topic_grid1 dishimg">
					<div class="view view-sixth">
                        <a href="{% url 'dishes:one_dish' %}?id={{ dish.id }}" target="_blank">
                            <img src="{% static dish.dish_img %}" class="img-responsive  carousel-inner img-rounded" alt=""/>
                            <div class="mask">
                                <h2>{{ dish.dish_name }} ￥{{ dish.dish_price }}</h2>
                                <p>{{ dish.dish_short }}</p>
                            </div>
                        </a>
                    </div>
				</div>
                {% endfor %}

            </div>
        </div>

{#        页码#}
            <div class="pagenation">
                {% if dishes.has_previous %}
                <a href="{% url 'dishes:all_dishes' param %}?page={{ dishes.previous_page_number }}">上一页</a>
                {% endif %}

                {% for index in paginator.page_range %}
                <a {% if index == dishes.number %}class="active" {% endif %}href="{% url 'dishes:all_dishes' param %}?page={{ index }}">{{ index }}</a>
                {% endfor %}

                {% if dishes.has_next %}
                <a href="{% url 'dishes:all_dishes' param %}?page={{ dishes.next_page_number }}">下一页</a>
                {% endif %}
            </div>



{% endblock body %}